import operate from '@dfeidao/atom-nodejs/db/operate';
// import doc_code from '@dfeidao/atom-nodejs/msg/doc-code';


interface Message {
	productid: string;
	tenantid: string;
	tenant_level: string;
}
export default async function atom(msg: Message, action_id: string, session_id: string) {

	const { update, exec } = operate(action_id, session_id, '12');

	update('pub_tenant', { tenantid: msg.tenantid }, { tenantid: msg.tenantid, tenant_level: msg.tenant_level });

	const res = await exec();


	if (res.code === 1) {
		return 'success';
	} else {
		return 'fail';
	}

}
